package leetcode.weekly.week301;

import java.util.Arrays;

//Solution1Test
public class Solution1 {
	// Solution1Test
	public int fillCups(int[] amount) {
		Arrays.sort(amount);
		int a = amount[0], b = amount[1], c = amount[2];
		if (a + b <= c) {
			return c;
		}
		int d = b - c;
		int d1 = a - d;
		int d2 = d1 >> 1;
		return b + d2 + a - d2 * 2 +  c - b;
	}

}
